package com.eedi.framework.protocol.dal.mapper;


import com.eedi.framework.common.pojo.PageResult;
import com.eedi.framework.mybatis.core.mapper.BaseMapperX;
import com.eedi.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.eedi.framework.protocol.controller.sys.vo.SysProtocolPageReq;
import com.eedi.framework.protocol.dal.dataobject.ProtocolDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 协议配置 Mapper
 *
 * @author 永聚长青源码
 */
@Mapper
public interface ProtocolMapper extends BaseMapperX<ProtocolDO> {

    default PageResult<ProtocolDO> selectPage(SysProtocolPageReq reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ProtocolDO>()
                .likeIfPresent(ProtocolDO::getSysProtocolName, reqVO.getName())
                .eqIfPresent(ProtocolDO::getSysProtocolApplyType, reqVO.getProtocolApplyType())
                .orderByAsc(ProtocolDO::getSysProtocolSort));
    }

}
